package com.example.gateway.utils;


import org.springframework.util.CollectionUtils;

import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

/**
 * @Author : wxy
 * @Date : 2021/1/17 16:49
 */
public final class SWUrlsUtils {

    private static final List<String> URLS = Arrays.asList("v2", "login", "WXPay");

    /**
     * 判断访问路径是否是swagger路径
     */
    public static Boolean judgeSwaggerUrl(String url) {
        List<String> list = Arrays.stream(url.split(Pattern.quote("/"))).collect(Collectors.toList());
        return CollectionUtils.containsAny(list, URLS);
    }
}
